package com.zb.springcloud.controller;

import com.zb.springcloud.domain.CommonResult;
import com.zb.springcloud.service.StorageService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class StorageController {
    @Resource
    StorageService storageService;

    @PostMapping(value = "/storage/decrease")
    public CommonResult create(Long productId, Integer count) {
        storageService.decrease(productId, count);
        return new CommonResult(200, "减库存成功");
    }

}
